var path = require('path');

module.exports = {
    entry: ['./src/book/Books.js'],
    output: {
        path: path.join(__dirname, '/dist'),
        publicPath: "/dist/",
        filename: 'bundle.js'
    },
    watch: true,
    devServer: {
        proxy: {
            '/bookService/': {
                target: 'http://127.0.0.1:8080',
                secure: false
            },
            '/recommendationService': {
                target: 'http://127.0.0.1:8079',
                secure: false
            },
            // '/contentService': {
            //     target: 'http://127.0.0.1:8080',
            //     secure: false
            // }
        }
    },
    resolve: {
        extensions: ['', '.js', '.jsx']
    },
    module: {
        loaders: [
            { test: /\.css$/, loader: "style-loader!css-loader" },
            { test: /\.jpg|png$/, loader: "url?limit=10000" },
            {
                test: /\.js|jsx$/,
                loader: 'babel-loader',
                exclude: /node_modules|lib/,
                query: {
                    presets: ['react', 'es2015']
                }
            }
        ],
        noParse: /node_modules\/quill\/dist/
    }
}